{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Jupyter OpenModelica Kernel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An example interaction of OpenModelica in Jupyter Notebook is presented below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('Pendulum',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class Pendulum \"Planar Pendulum\"\n",
    "   constant Real PI=3.141592653589793;\n",
    "   parameter Real m=1, g=9.81, L=0.5;\n",
    "   Real F;\n",
    "   output Real x(start=0.5),y(start=0);\n",
    "   output Real vx,vy;\n",
    "equation\n",
    "   m*der(vx)=-(x/L)*F;\n",
    "   m*der(vy)=-(y/L)*F-m*g;\n",
    "   der(x)=vx;\n",
    "   der(y)=vy;\n",
    "   x^2+y^2=L^2;\n",
    "end Pendulum;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'timeCompile': 2.940272563866557, 'simulationOptions': \"startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'Pendulum', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''\", 'timeBackend': 0.02842686339757349, 'messages': '', 'timeFrontend': 0.01660080305247645, 'timeSimulation': 0.2298454308254777, 'timeTemplates': 0.07324553280483828, 'timeSimCode': 0.00807950844641955, 'timeTotal': 3.2968089230541, 'resultFile': 'F:/jupyter/Pendulum_res.mat'}"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "simulate(Pendulum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<html> <head> <script src=\"dygraph-combined.js\"> </script> </head>\n",
       "<div id=8> </div>\n",
       "<script type=\"text/javascript\"> g = new Dygraph(document.getElementById(\"8\"),  [[  0.00000000e+00,   0.00000000e+00,  -0.00000000e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.00000000e-03,  -7.69888829e-07,  -1.96200000e-02,\n",
       "          1.00000000e+00],\n",
       "       [  4.00000000e-03,  -6.15911017e-06,  -3.92399987e-02,\n",
       "          1.00000000e+00],\n",
       "       [  6.00000000e-03,  -2.07869901e-05,  -5.88599872e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.00000000e-03,  -4.92728454e-05,  -7.84799575e-02,\n",
       "          1.00000000e+00],\n",
       "       [  1.00000000e-02,  -9.62359061e-05,  -9.80998709e-02,\n",
       "          1.00000000e+00],\n",
       "       [  1.20000000e-02,  -1.66295008e-04,  -1.17719589e-01,\n",
       "          1.00000000e+00],\n",
       "       [  1.40000000e-02,  -2.64069387e-04,  -1.37339179e-01,\n",
       "          1.00000000e+00],\n",
       "       [  1.60000000e-02,  -3.94178210e-04,  -1.56958641e-01,\n",
       "          1.00000000e+00],\n",
       "       [  1.80000000e-02,  -5.61240760e-04,  -1.76577974e-01,\n",
       "          1.00000000e+00],\n",
       "       [  2.00000000e-02,  -7.69874126e-04,  -1.96196832e-01,\n",
       "          1.00000000e+00],\n",
       "       [  2.20000000e-02,  -1.02469598e-03,  -2.15815095e-01,\n",
       "          1.00000000e+00],\n",
       "       [  2.40000000e-02,  -1.33032688e-03,  -2.35432991e-01,\n",
       "          1.00000000e+00],\n",
       "       [  2.60000000e-02,  -1.69138657e-03,  -2.55050521e-01,\n",
       "          1.00000000e+00],\n",
       "       [  2.80000000e-02,  -2.11248748e-03,  -2.74667038e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.00000000e-02,  -2.59824859e-03,  -2.94282578e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.20000000e-02,  -3.15328845e-03,  -3.13897088e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.40000000e-02,  -3.78221161e-03,  -3.33509682e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.60000000e-02,  -4.48964411e-03,  -3.53120799e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.80000000e-02,  -5.28018517e-03,  -3.72729472e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.00000000e-02,  -6.15845585e-03,  -3.92335833e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.20000000e-02,  -7.12905856e-03,  -4.11939225e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.40000000e-02,  -8.19660225e-03,  -4.31539300e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.60000000e-02,  -9.36568778e-03,  -4.51135487e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.80000000e-02,  -1.06409223e-02,  -4.70727430e-01,\n",
       "          1.00000000e+00],\n",
       "       [  5.00000000e-02,  -1.20268829e-02,  -4.90314025e-01,\n",
       "          1.00000000e+00],\n",
       "       [  5.20000000e-02,  -1.35281874e-02,  -5.09895277e-01,\n",
       "          1.00000000e+00],\n",
       "       [  5.40000000e-02,  -1.51493988e-02,  -5.29469887e-01,\n",
       "          1.00000000e+00],\n",
       "       [  5.60000000e-02,  -1.68951186e-02,  -5.49037538e-01,\n",
       "          1.00000000e+00],\n",
       "       [  5.80000000e-02,  -1.87699190e-02,  -5.68597292e-01,\n",
       "          1.00000000e+00],\n",
       "       [  6.00000000e-02,  -2.07783485e-02,  -5.88147916e-01,\n",
       "          1.00000000e+00],\n",
       "       [  6.20000000e-02,  -2.29249927e-02,  -6.07688887e-01,\n",
       "          1.00000000e+00],\n",
       "       [  6.40000000e-02,  -2.52144023e-02,  -6.27219111e-01,\n",
       "          1.00000000e+00],\n",
       "       [  6.60000000e-02,  -2.76510955e-02,  -6.46737120e-01,\n",
       "          1.00000000e+00],\n",
       "       [  6.80000000e-02,  -3.02396366e-02,  -6.66242210e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.00000000e-02,  -3.29845614e-02,  -6.85733287e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.20000000e-02,  -3.58903800e-02,  -7.05208987e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.40000000e-02,  -3.89616022e-02,  -7.24668029e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.60000000e-02,  -4.22027009e-02,  -7.44108784e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.80000000e-02,  -4.56181528e-02,  -7.63529772e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.00000000e-02,  -4.92123994e-02,  -7.82929262e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.20000000e-02,  -5.29898744e-02,  -8.02305538e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.40000000e-02,  -5.69550093e-02,  -8.21656922e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.60000000e-02,  -6.11121739e-02,  -8.40981369e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.80000000e-02,  -6.54657806e-02,  -8.60277187e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.00000000e-02,  -7.00201888e-02,  -8.79542372e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.20000000e-02,  -7.47797016e-02,  -8.98774628e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.40000000e-02,  -7.97486898e-02,  -9.17972153e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.60000000e-02,  -8.49313298e-02,  -9.37132050e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.80000000e-02,  -9.03318816e-02,  -9.56252017e-01,\n",
       "          1.00000000e+00],\n",
       "       [  1.00000000e-01,  -9.59545932e-02,  -9.75329752e-01,\n",
       "          1.00000000e+00],\n",
       "       [  1.02000000e-01,  -1.01803567e-01,  -9.94362272e-01,\n",
       "          1.00000000e+00],\n",
       "       [  1.04000000e-01,  -1.07883026e-01,  -1.01334728e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.06000000e-01,  -1.14197007e-01,  -1.03228165e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.08000000e-01,  -1.20749628e-01,  -1.05116273e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.10000000e-01,  -1.27544892e-01,  -1.06998742e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.12000000e-01,  -1.34586732e-01,  -1.08875240e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.14000000e-01,  -1.41879134e-01,  -1.10745470e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.16000000e-01,  -1.49425862e-01,  -1.12609052e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.18000000e-01,  -1.57230838e-01,  -1.14465679e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.20000000e-01,  -1.65297711e-01,  -1.16314950e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.22000000e-01,  -1.73630255e-01,  -1.18156523e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.24000000e-01,  -1.82232105e-01,  -1.19990012e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.26000000e-01,  -1.91106764e-01,  -1.21815004e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.28000000e-01,  -2.00257765e-01,  -1.23631102e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.30000000e-01,  -2.09688538e-01,  -1.25437888e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.32000000e-01,  -2.19402442e-01,  -1.27234933e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.34000000e-01,  -2.29402741e-01,  -1.29021792e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.36000000e-01,  -2.39692641e-01,  -1.30798013e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.38000000e-01,  -2.50275265e-01,  -1.32563132e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.40000000e-01,  -2.61153652e-01,  -1.34316672e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.42000000e-01,  -2.72330729e-01,  -1.36058141e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.44000000e-01,  -2.83809262e-01,  -1.37787031e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.46000000e-01,  -2.95592039e-01,  -1.39502832e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.48000000e-01,  -3.07681702e-01,  -1.41205017e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.50000000e-01,  -3.20080795e-01,  -1.42893048e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.52000000e-01,  -3.32791682e-01,  -1.44566372e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.54000000e-01,  -3.45816641e-01,  -1.46224424e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.56000000e-01,  -3.59157888e-01,  -1.47866630e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.58000000e-01,  -3.72817487e-01,  -1.49492402e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.60000000e-01,  -3.86797382e-01,  -1.51101140e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.62000000e-01,  -4.01099271e-01,  -1.52692238e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.64000000e-01,  -4.15724856e-01,  -1.54265069e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.66000000e-01,  -4.30675663e-01,  -1.55818998e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.68000000e-01,  -4.45953069e-01,  -1.57353378e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.70000000e-01,  -4.61558287e-01,  -1.58867554e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.72000000e-01,  -4.77492328e-01,  -1.60360867e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.74000000e-01,  -4.93756134e-01,  -1.61832630e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.76000000e-01,  -5.10350447e-01,  -1.63282154e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.78000000e-01,  -5.27275846e-01,  -1.64708735e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.80000000e-01,  -5.44532718e-01,  -1.66111671e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.82000000e-01,  -5.62121277e-01,  -1.67490246e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.84000000e-01,  -5.80041569e-01,  -1.68843725e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.86000000e-01,  -5.98293442e-01,  -1.70171369e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.88000000e-01,  -6.16876550e-01,  -1.71472429e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.90000000e-01,  -6.35790386e-01,  -1.72746162e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.92000000e-01,  -6.55034198e-01,  -1.73991799e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.94000000e-01,  -6.74607040e-01,  -1.75208569e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.96000000e-01,  -6.94507753e-01,  -1.76395692e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.98000000e-01,  -7.14734978e-01,  -1.77552385e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.00000000e-01,  -7.35287170e-01,  -1.78677859e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.02000000e-01,  -7.56162498e-01,  -1.79771316e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.04000000e-01,  -7.77358925e-01,  -1.80831949e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.06000000e-01,  -7.98874177e-01,  -1.81858951e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.08000000e-01,  -8.20705793e-01,  -1.82851513e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.10000000e-01,  -8.42851049e-01,  -1.83808822e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.12000000e-01,  -8.65306949e-01,  -1.84730055e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.14000000e-01,  -8.88070262e-01,  -1.85614387e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.16000000e-01,  -9.11137502e-01,  -1.86460993e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.18000000e-01,  -9.34505020e-01,  -1.87269059e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.20000000e-01,  -9.58168796e-01,  -1.88037751e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.22000000e-01,  -9.82124585e-01,  -1.88766242e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.24000000e-01,  -1.00636787e+00,  -1.89453704e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.26000000e-01,  -1.03089390e+00,  -1.90099315e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.28000000e-01,  -1.05569769e+00,  -1.90702260e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.30000000e-01,  -1.08077390e+00,  -1.91261713e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.32000000e-01,  -1.10611694e+00,  -1.91776858e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.34000000e-01,  -1.13172095e+00,  -1.92246882e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.36000000e-01,  -1.15757985e+00,  -1.92670984e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.38000000e-01,  -1.18368724e+00,  -1.93048365e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.40000000e-01,  -1.21003641e+00,  -1.93378230e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.42000000e-01,  -1.23662038e+00,  -1.93659792e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.44000000e-01,  -1.26343189e+00,  -1.93892273e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.46000000e-01,  -1.29046351e+00,  -1.94074915e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.48000000e-01,  -1.31770740e+00,  -1.94206958e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.50000000e-01,  -1.34515543e+00,  -1.94287655e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.52000000e-01,  -1.37279923e+00,  -1.94316274e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.54000000e-01,  -1.40063015e+00,  -1.94292097e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.56000000e-01,  -1.42863935e+00,  -1.94214424e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.58000000e-01,  -1.45681756e+00,  -1.94082561e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.60000000e-01,  -1.48515528e+00,  -1.93895836e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.62000000e-01,  -1.51364273e+00,  -1.93653591e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.64000000e-01,  -1.54226995e+00,  -1.93355192e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.66000000e-01,  -1.57102665e+00,  -1.93000022e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.68000000e-01,  -1.59990223e+00,  -1.92587481e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.70000000e-01,  -1.62888584e+00,  -1.92116990e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.72000000e-01,  -1.65796638e+00,  -1.91587996e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.74000000e-01,  -1.68713262e+00,  -1.90999971e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.76000000e-01,  -1.71637291e+00,  -1.90352406e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.78000000e-01,  -1.74567541e+00,  -1.89644818e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.80000000e-01,  -1.77502801e+00,  -1.88876752e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.82000000e-01,  -1.80441844e+00,  -1.88047779e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.84000000e-01,  -1.83383421e+00,  -1.87157501e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.86000000e-01,  -1.86326253e+00,  -1.86205545e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.88000000e-01,  -1.89269041e+00,  -1.85191571e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.90000000e-01,  -1.92210467e+00,  -1.84115269e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.92000000e-01,  -1.95149197e+00,  -1.82976361e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.94000000e-01,  -1.98083877e+00,  -1.81774599e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.96000000e-01,  -2.01013128e+00,  -1.80509775e+00,\n",
       "          1.00000000e+00],\n",
       "       [  2.98000000e-01,  -2.03935560e+00,  -1.79181712e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.00000000e-01,  -2.06849442e+00,  -1.77788252e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.02000000e-01,  -2.09753872e+00,  -1.76333310e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.04000000e-01,  -2.12647174e+00,  -1.74814757e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.06000000e-01,  -2.15527976e+00,  -1.73232651e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.08000000e-01,  -2.18394856e+00,  -1.71587024e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.10000000e-01,  -2.21246301e+00,  -1.69877887e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.12000000e-01,  -2.24080775e+00,  -1.68105291e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.14000000e-01,  -2.26896780e+00,  -1.66269378e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.16000000e-01,  -2.29692838e+00,  -1.64370341e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.18000000e-01,  -2.32467433e+00,  -1.62408381e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.20000000e-01,  -2.35219049e+00,  -1.60383721e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.22000000e-01,  -2.37946178e+00,  -1.58296677e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.24000000e-01,  -2.40647310e+00,  -1.56147572e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.26000000e-01,  -2.43320926e+00,  -1.53936799e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.28000000e-01,  -2.45965509e+00,  -1.51664767e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.30000000e-01,  -2.48579547e+00,  -1.49331961e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.32000000e-01,  -2.51161525e+00,  -1.46938873e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.34000000e-01,  -2.53709936e+00,  -1.44486055e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.36000000e-01,  -2.56223276e+00,  -1.41974109e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.38000000e-01,  -2.58700053e+00,  -1.39403680e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.40000000e-01,  -2.61138784e+00,  -1.36775465e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.42000000e-01,  -2.63537994e+00,  -1.34090197e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.44000000e-01,  -2.65896220e+00,  -1.31348654e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.46000000e-01,  -2.68212017e+00,  -1.28551661e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.48000000e-01,  -2.70483951e+00,  -1.25700086e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.50000000e-01,  -2.72710609e+00,  -1.22794839e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.52000000e-01,  -2.74890593e+00,  -1.19836872e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.54000000e-01,  -2.77022526e+00,  -1.16827182e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.56000000e-01,  -2.79105053e+00,  -1.13766808e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.58000000e-01,  -2.81136840e+00,  -1.10656829e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.60000000e-01,  -2.83116580e+00,  -1.07498366e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.62000000e-01,  -2.85042989e+00,  -1.04292583e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.64000000e-01,  -2.86914809e+00,  -1.01040682e+00,\n",
       "          1.00000000e+00],\n",
       "       [  3.66000000e-01,  -2.88730816e+00,  -9.77439062e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.68000000e-01,  -2.90489812e+00,  -9.44035370e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.70000000e-01,  -2.92190635e+00,  -9.10208951e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.72000000e-01,  -2.93832152e+00,  -8.75973386e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.74000000e-01,  -2.95413267e+00,  -8.41342566e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.76000000e-01,  -2.96932918e+00,  -8.06330773e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.78000000e-01,  -2.98390084e+00,  -7.70952639e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.80000000e-01,  -2.99783782e+00,  -7.35223120e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.82000000e-01,  -3.01113058e+00,  -6.99157404e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.84000000e-01,  -3.02377007e+00,  -6.62771046e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.86000000e-01,  -3.03574768e+00,  -6.26079896e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.88000000e-01,  -3.04705520e+00,  -5.89100066e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.90000000e-01,  -3.05768475e+00,  -5.51847894e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.92000000e-01,  -3.06762899e+00,  -5.14339998e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.94000000e-01,  -3.07688103e+00,  -4.76593231e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.96000000e-01,  -3.08543444e+00,  -4.38624662e-01,\n",
       "          1.00000000e+00],\n",
       "       [  3.98000000e-01,  -3.09328320e+00,  -4.00451578e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.00000000e-01,  -3.10042181e+00,  -3.62091454e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.02000000e-01,  -3.10684529e+00,  -3.23561944e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.04000000e-01,  -3.11254912e+00,  -2.84880871e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.06000000e-01,  -3.11752928e+00,  -2.46066183e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.08000000e-01,  -3.12178226e+00,  -2.07135981e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.10000000e-01,  -3.12530512e+00,  -1.68108484e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.12000000e-01,  -3.12809541e+00,  -1.29002006e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.14000000e-01,  -3.13015108e+00,  -8.98348465e-02,\n",
       "          1.00000000e+00],\n",
       "       [  4.16000000e-01,  -3.13147075e+00,  -5.06254446e-02,\n",
       "          1.00000000e+00],\n",
       "       [  4.18000000e-01,  -3.13205357e+00,  -1.13922739e-02,\n",
       "          1.00000000e+00],\n",
       "       [  4.20000000e-01,  -3.13189920e+00,   2.78461825e-02,\n",
       "          1.00000000e+00],\n",
       "       [  4.22000000e-01,  -3.13100759e+00,   6.70715089e-02,\n",
       "          1.00000000e+00],\n",
       "       [  4.24000000e-01,  -3.12937943e+00,   1.06265250e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.26000000e-01,  -3.12701594e+00,   1.45408994e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.28000000e-01,  -3.12391882e+00,   1.84484399e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.30000000e-01,  -3.12009009e+00,   2.23473124e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.32000000e-01,  -3.11553247e+00,   2.62356968e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.34000000e-01,  -3.11024914e+00,   3.01117834e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.36000000e-01,  -3.10424381e+00,   3.39737737e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.38000000e-01,  -3.09752062e+00,   3.78198694e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.40000000e-01,  -3.09008425e+00,   4.16482972e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.42000000e-01,  -3.08193988e+00,   4.54572983e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.44000000e-01,  -3.07309319e+00,   4.92451297e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.46000000e-01,  -3.06355033e+00,   5.30100676e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.48000000e-01,  -3.05331796e+00,   5.67504081e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.50000000e-01,  -3.04240322e+00,   6.04644692e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.52000000e-01,  -3.03081375e+00,   6.41505929e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.54000000e-01,  -3.01855731e+00,   6.78071621e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.56000000e-01,  -3.00564243e+00,   7.14325743e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.58000000e-01,  -2.99207801e+00,   7.50252590e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.60000000e-01,  -2.97787338e+00,   7.85836793e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.62000000e-01,  -2.96303807e+00,   8.21063161e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.64000000e-01,  -2.94758211e+00,   8.55916891e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.66000000e-01,  -2.93151597e+00,   8.90383597e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.68000000e-01,  -2.91485045e+00,   9.24449213e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.70000000e-01,  -2.89759664e+00,   9.58099945e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.72000000e-01,  -2.87976595e+00,   9.91322321e-01,\n",
       "          1.00000000e+00],\n",
       "       [  4.74000000e-01,  -2.86137020e+00,   1.02410338e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.76000000e-01,  -2.84242146e+00,   1.05643048e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.78000000e-01,  -2.82293213e+00,   1.08829138e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.80000000e-01,  -2.80291483e+00,   1.11967414e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.82000000e-01,  -2.78238251e+00,   1.15056735e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.84000000e-01,  -2.76134837e+00,   1.18095993e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.86000000e-01,  -2.73982584e+00,   1.21084128e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.88000000e-01,  -2.71782850e+00,   1.24020113e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.90000000e-01,  -2.69537025e+00,   1.26902973e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.92000000e-01,  -2.67246515e+00,   1.29731772e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.94000000e-01,  -2.64912744e+00,   1.32505622e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.96000000e-01,  -2.62537145e+00,   1.35223667e+00,\n",
       "          1.00000000e+00],\n",
       "       [  4.98000000e-01,  -2.60121174e+00,   1.37885107e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.00000000e-01,  -2.57666298e+00,   1.40489185e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.02000000e-01,  -2.55173998e+00,   1.43035188e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.04000000e-01,  -2.52645759e+00,   1.45522440e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.06000000e-01,  -2.50083078e+00,   1.47950315e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.08000000e-01,  -2.47487459e+00,   1.50318235e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.10000000e-01,  -2.44860412e+00,   1.52625665e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.12000000e-01,  -2.42203452e+00,   1.54872110e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.14000000e-01,  -2.39518094e+00,   1.57057116e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.16000000e-01,  -2.36805856e+00,   1.59180283e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.18000000e-01,  -2.34068254e+00,   1.61241248e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.20000000e-01,  -2.31306804e+00,   1.63239694e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.22000000e-01,  -2.28523024e+00,   1.65175340e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.24000000e-01,  -2.25718419e+00,   1.67047956e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.26000000e-01,  -2.22894493e+00,   1.68857348e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.28000000e-01,  -2.20052740e+00,   1.70603367e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.30000000e-01,  -2.17194657e+00,   1.72285901e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.32000000e-01,  -2.14321718e+00,   1.73904881e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.34000000e-01,  -2.11435393e+00,   1.75460276e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.36000000e-01,  -2.08537137e+00,   1.76952095e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.38000000e-01,  -2.05628403e+00,   1.78380385e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.40000000e-01,  -2.02710619e+00,   1.79745230e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.42000000e-01,  -1.99785200e+00,   1.81046750e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.44000000e-01,  -1.96853545e+00,   1.82285101e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.46000000e-01,  -1.93917044e+00,   1.83460477e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.48000000e-01,  -1.90977064e+00,   1.84573103e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.50000000e-01,  -1.88034951e+00,   1.85623238e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.52000000e-01,  -1.85092030e+00,   1.86611171e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.54000000e-01,  -1.82149613e+00,   1.87537229e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.56000000e-01,  -1.79208992e+00,   1.88401765e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.58000000e-01,  -1.76271430e+00,   1.89205162e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.60000000e-01,  -1.73338167e+00,   1.89947830e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.62000000e-01,  -1.70410424e+00,   1.90630209e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.64000000e-01,  -1.67489407e+00,   1.91252771e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.66000000e-01,  -1.64575795e+00,   1.91815517e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.68000000e-01,  -1.61671809e+00,   1.92319956e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.70000000e-01,  -1.58778222e+00,   1.92766221e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.72000000e-01,  -1.55895932e+00,   1.93154807e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.74000000e-01,  -1.53026017e+00,   1.93486307e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.76000000e-01,  -1.50169523e+00,   1.93761332e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.78000000e-01,  -1.47327370e+00,   1.93980463e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.80000000e-01,  -1.44500459e+00,   1.94144303e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.82000000e-01,  -1.41689669e+00,   1.94253459e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.84000000e-01,  -1.38896074e+00,   1.94308666e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.86000000e-01,  -1.36120604e+00,   1.94310619e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.88000000e-01,  -1.33364232e+00,   1.94260072e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.90000000e-01,  -1.30627822e+00,   1.94157759e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.92000000e-01,  -1.27912225e+00,   1.94004427e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.94000000e-01,  -1.25218204e+00,   1.93800829e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.96000000e-01,  -1.22546535e+00,   1.93547714e+00,\n",
       "          1.00000000e+00],\n",
       "       [  5.98000000e-01,  -1.19897925e+00,   1.93245857e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.00000000e-01,  -1.17273072e+00,   1.92896027e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.02000000e-01,  -1.14672670e+00,   1.92499011e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.04000000e-01,  -1.12097371e+00,   1.92055604e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.06000000e-01,  -1.09547817e+00,   1.91566608e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.08000000e-01,  -1.07024608e+00,   1.91032830e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.10000000e-01,  -1.04528307e+00,   1.90455077e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.12000000e-01,  -1.02059460e+00,   1.89834168e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.14000000e-01,  -9.96185851e-01,   1.89170925e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.16000000e-01,  -9.72061968e-01,   1.88466170e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.18000000e-01,  -9.48227612e-01,   1.87720737e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.20000000e-01,  -9.24687285e-01,   1.86935462e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.22000000e-01,  -9.01444898e-01,   1.86111151e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.24000000e-01,  -8.78504304e-01,   1.85248631e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.26000000e-01,  -8.55869186e-01,   1.84348738e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.28000000e-01,  -8.33542901e-01,   1.83412292e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.30000000e-01,  -8.11528554e-01,   1.82440108e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.32000000e-01,  -7.89829043e-01,   1.81433014e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.34000000e-01,  -7.68447001e-01,   1.80391827e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.36000000e-01,  -7.47384747e-01,   1.79317340e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.38000000e-01,  -7.26644483e-01,   1.78210371e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.40000000e-01,  -7.06228154e-01,   1.77071725e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.42000000e-01,  -6.86137428e-01,   1.75902183e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.44000000e-01,  -6.66373816e-01,   1.74702542e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.46000000e-01,  -6.46938607e-01,   1.73473588e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.48000000e-01,  -6.27832838e-01,   1.72216089e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.50000000e-01,  -6.09057358e-01,   1.70930812e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.52000000e-01,  -5.90612838e-01,   1.69618522e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.54000000e-01,  -5.72499733e-01,   1.68279972e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.56000000e-01,  -5.54718291e-01,   1.66915900e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.58000000e-01,  -5.37268594e-01,   1.65527042e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.60000000e-01,  -5.20150528e-01,   1.64114125e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.62000000e-01,  -5.03363801e-01,   1.62677866e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.64000000e-01,  -4.86907942e-01,   1.61218970e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.66000000e-01,  -4.70782308e-01,   1.59738132e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.68000000e-01,  -4.54986089e-01,   1.58236034e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.70000000e-01,  -4.39518308e-01,   1.56713348e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.72000000e-01,  -4.24377830e-01,   1.55170736e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.74000000e-01,  -4.09563360e-01,   1.53608847e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.76000000e-01,  -3.95073454e-01,   1.52028315e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.78000000e-01,  -3.80906542e-01,   1.50429771e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.80000000e-01,  -3.67060994e-01,   1.48813856e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.82000000e-01,  -3.53534903e-01,   1.47181157e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.84000000e-01,  -3.40326285e-01,   1.45532269e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.86000000e-01,  -3.27433028e-01,   1.43867769e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.88000000e-01,  -3.14852897e-01,   1.42188225e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.90000000e-01,  -3.02583576e-01,   1.40494205e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.92000000e-01,  -2.90622624e-01,   1.38786260e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.94000000e-01,  -2.78967448e-01,   1.37064917e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.96000000e-01,  -2.67615372e-01,   1.35330696e+00,\n",
       "          1.00000000e+00],\n",
       "       [  6.98000000e-01,  -2.56563618e-01,   1.33584106e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.00000000e-01,  -2.45809321e-01,   1.31825647e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.02000000e-01,  -2.35349524e-01,   1.30055812e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.04000000e-01,  -2.25181158e-01,   1.28275068e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.06000000e-01,  -2.15301076e-01,   1.26483877e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.08000000e-01,  -2.05706045e-01,   1.24682686e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.10000000e-01,  -1.96392761e-01,   1.22871935e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.12000000e-01,  -1.87357844e-01,   1.21052056e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.14000000e-01,  -1.78597828e-01,   1.19223456e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.16000000e-01,  -1.70109182e-01,   1.17386539e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.18000000e-01,  -1.61888305e-01,   1.15541691e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.20000000e-01,  -1.53931537e-01,   1.13689294e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.22000000e-01,  -1.46235159e-01,   1.11829717e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.24000000e-01,  -1.38795384e-01,   1.09963313e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.26000000e-01,  -1.31608374e-01,   1.08090424e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.28000000e-01,  -1.24670238e-01,   1.06211381e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.30000000e-01,  -1.17977034e-01,   1.04326506e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.32000000e-01,  -1.11524782e-01,   1.02436115e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.34000000e-01,  -1.05309443e-01,   1.00540502e+00,\n",
       "          1.00000000e+00],\n",
       "       [  7.36000000e-01,  -9.93269414e-02,   9.86399566e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.38000000e-01,  -9.35731608e-02,   9.67347543e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.40000000e-01,  -8.80439475e-02,   9.48251627e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.42000000e-01,  -8.27351181e-02,   9.29114463e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.44000000e-01,  -7.76424461e-02,   9.09938480e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.46000000e-01,  -7.27616771e-02,   8.90726051e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.48000000e-01,  -6.80885270e-02,   8.71479446e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.50000000e-01,  -6.36186837e-02,   8.52200846e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.52000000e-01,  -5.93478087e-02,   8.32892389e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.54000000e-01,  -5.52715397e-02,   8.13556048e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.56000000e-01,  -5.13854914e-02,   7.94193732e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.58000000e-01,  -4.76852575e-02,   7.74807262e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.60000000e-01,  -4.41664120e-02,   7.55398372e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.62000000e-01,  -4.08245043e-02,   7.35968727e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.64000000e-01,  -3.76550749e-02,   7.16519890e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.66000000e-01,  -3.46536456e-02,   6.97053347e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.68000000e-01,  -3.18157237e-02,   6.77570508e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.70000000e-01,  -2.91368034e-02,   6.58072703e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.72000000e-01,  -2.66123626e-02,   6.38561201e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.74000000e-01,  -2.42378726e-02,   6.19037180e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.76000000e-01,  -2.20087930e-02,   5.99501754e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.78000000e-01,  -1.99205742e-02,   5.79955964e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.80000000e-01,  -1.79686580e-02,   5.60400786e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.82000000e-01,  -1.61484776e-02,   5.40837158e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.84000000e-01,  -1.44554602e-02,   5.21265927e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.86000000e-01,  -1.28850271e-02,   5.01687882e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.88000000e-01,  -1.14325937e-02,   4.82103757e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.90000000e-01,  -1.00935707e-02,   4.62514230e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.92000000e-01,  -8.86336290e-03,   4.42919948e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.94000000e-01,  -7.73737254e-03,   4.23321489e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.96000000e-01,  -6.71099888e-03,   4.03719379e-01,\n",
       "          1.00000000e+00],\n",
       "       [  7.98000000e-01,  -5.77963786e-03,   3.84114101e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.00000000e-01,  -4.93868293e-03,   3.64506094e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.02000000e-01,  -4.18352306e-03,   3.44895757e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.04000000e-01,  -3.50954687e-03,   3.25283448e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.06000000e-01,  -2.91214239e-03,   3.05669486e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.08000000e-01,  -2.38669557e-03,   2.86054155e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.10000000e-01,  -1.92859119e-03,   2.66437707e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.12000000e-01,  -1.53321176e-03,   2.46820354e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.14000000e-01,  -1.19593962e-03,   2.27202278e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.16000000e-01,  -9.12157722e-04,   2.07583643e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.18000000e-01,  -6.77247872e-04,   1.87964583e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.20000000e-01,  -4.86591537e-04,   1.68345207e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.22000000e-01,  -3.35569515e-04,   1.48725605e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.24000000e-01,  -2.19562527e-04,   1.29105847e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.26000000e-01,  -1.33951757e-04,   1.09485986e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.28000000e-01,  -7.41180309e-05,   8.98660580e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.30000000e-01,  -3.54421306e-05,   7.02460884e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.32000000e-01,  -1.33046879e-05,   5.06260973e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.34000000e-01,  -3.08636395e-06,   3.10061021e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.36000000e-01,  -1.68028510e-07,   1.13861006e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.38000000e-01,   6.96109838e-08,  -8.23390661e-03,\n",
       "          1.00000000e+00],\n",
       "       [  8.40000000e-01,   2.24592848e-06,  -2.78539203e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.42000000e-01,   1.09803066e-05,  -4.74739383e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.44000000e-01,   3.08918309e-05,  -6.70939521e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.46000000e-01,   6.65999647e-05,  -8.67139530e-02,\n",
       "          1.00000000e+00],\n",
       "       [  8.48000000e-01,   1.22724164e-04,  -1.06333922e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.50000000e-01,   2.03884001e-04,  -1.25953830e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.52000000e-01,   3.14698856e-04,  -1.45573637e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.54000000e-01,   4.59786986e-04,  -1.65193299e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.56000000e-01,   6.43768058e-04,  -1.84812739e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.58000000e-01,   8.71261091e-04,  -2.04431870e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.60000000e-01,   1.14688496e-03,  -2.24050582e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.62000000e-01,   1.47525807e-03,  -2.43668746e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.64000000e-01,   1.86099686e-03,  -2.63286212e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.66000000e-01,   2.30871932e-03,  -2.82902797e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.68000000e-01,   2.82304196e-03,  -3.02518290e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.70000000e-01,   3.40858053e-03,  -3.22132450e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.72000000e-01,   4.06994966e-03,  -3.41745003e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.74000000e-01,   4.81176104e-03,  -3.61355633e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.76000000e-01,   5.63862703e-03,  -3.80963996e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.78000000e-01,   6.55515746e-03,  -4.00569703e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.80000000e-01,   7.56596020e-03,  -4.20172325e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.82000000e-01,   8.67564078e-03,  -4.39771388e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.84000000e-01,   9.88879860e-03,  -4.59366361e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.86000000e-01,   1.12100340e-02,  -4.78956679e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.88000000e-01,   1.26439422e-02,  -4.98541718e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.90000000e-01,   1.41951144e-02,  -5.18120803e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.92000000e-01,   1.58681374e-02,  -5.37693203e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.94000000e-01,   1.76675870e-02,  -5.57258132e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.96000000e-01,   1.95980395e-02,  -5.76814743e-01,\n",
       "          1.00000000e+00],\n",
       "       [  8.98000000e-01,   2.16640624e-02,  -5.96362124e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.00000000e-01,   2.38702159e-02,  -6.15899302e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.02000000e-01,   2.62210522e-02,  -6.35425236e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.04000000e-01,   2.87211092e-02,  -6.54938831e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.06000000e-01,   3.13749198e-02,  -6.74438907e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.08000000e-01,   3.41870051e-02,  -6.93924217e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.10000000e-01,   3.71618738e-02,  -7.13393437e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.12000000e-01,   4.03040215e-02,  -7.32845171e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.14000000e-01,   4.36179267e-02,  -7.52277948e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.16000000e-01,   4.71080545e-02,  -7.71690215e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.18000000e-01,   5.07788539e-02,  -7.91080333e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.20000000e-01,   5.46347553e-02,  -8.10446582e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.22000000e-01,   5.86801698e-02,  -8.29787154e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.24000000e-01,   6.29194849e-02,  -8.49100160e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.26000000e-01,   6.73570673e-02,  -8.68383614e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.28000000e-01,   7.19972608e-02,  -8.87635440e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.30000000e-01,   7.68443828e-02,  -9.06853469e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.32000000e-01,   8.19027232e-02,  -9.26035433e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.34000000e-01,   8.71765384e-02,  -9.45178981e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.36000000e-01,   9.26700544e-02,  -9.64281658e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.38000000e-01,   9.83874677e-02,  -9.83340898e-01,\n",
       "          1.00000000e+00],\n",
       "       [  9.40000000e-01,   1.04332937e-01,  -1.00235404e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.42000000e-01,   1.10510584e-01,  -1.02131831e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.44000000e-01,   1.16924491e-01,  -1.04023084e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.46000000e-01,   1.23578697e-01,  -1.05908865e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.48000000e-01,   1.30477196e-01,  -1.07788866e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.50000000e-01,   1.37623936e-01,  -1.09662772e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.52000000e-01,   1.45022818e-01,  -1.11530249e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.54000000e-01,   1.52677687e-01,  -1.13390956e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.56000000e-01,   1.60592337e-01,  -1.15244538e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.58000000e-01,   1.68770503e-01,  -1.17090630e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.60000000e-01,   1.77215859e-01,  -1.18928857e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.62000000e-01,   1.85932015e-01,  -1.20758828e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.64000000e-01,   1.94922501e-01,  -1.22580156e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.66000000e-01,   2.04190798e-01,  -1.24392420e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.68000000e-01,   2.13740307e-01,  -1.26195198e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.70000000e-01,   2.23574350e-01,  -1.27988052e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.72000000e-01,   2.33696170e-01,  -1.29770534e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.74000000e-01,   2.44108925e-01,  -1.31542182e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.76000000e-01,   2.54815688e-01,  -1.33302522e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.78000000e-01,   2.65819466e-01,  -1.35051090e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.80000000e-01,   2.77123138e-01,  -1.36787379e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.82000000e-01,   2.88729493e-01,  -1.38510877e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.84000000e-01,   3.00641221e-01,  -1.40221061e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.86000000e-01,   3.12860904e-01,  -1.41917397e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.88000000e-01,   3.25391013e-01,  -1.43599336e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.90000000e-01,   3.38233904e-01,  -1.45266317e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.92000000e-01,   3.51391858e-01,  -1.46917798e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.94000000e-01,   3.64867000e-01,  -1.48553197e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.96000000e-01,   3.78661309e-01,  -1.50171909e+00,\n",
       "          1.00000000e+00],\n",
       "       [  9.98000000e-01,   3.92776649e-01,  -1.51773328e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.00000000e+00,   4.07214745e-01,  -1.53356836e+00,\n",
       "          1.00000000e+00],\n",
       "       [  1.00000000e+00,   4.07214745e-01,  -1.53356836e+00,\n",
       "          1.00000000e+00]] ,{ legend:\"always\", labels: ['Time', 'der(x)', 'der(y)', 'm'] })</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot(der(x),der(y),m)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('GreenClass',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "type GreenClass = Real(unit = \"green\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('YellowClass',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "type YellowClass = Real(unit = \"yellow\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('C',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class C\n",
    "  replaceable GreenClass  obj1(p1=5);\n",
    "  replaceable YellowClass obj2;\n",
    "  replaceable GreenClass  obj3;\n",
    "end C;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('C2',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class C2 = C(redeclare RedClass obj1, redeclare GreenClass obj2);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('C2b',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class C2b\n",
    "  RedClass obj1(p1=5);    //type\n",
    "  GreenClass obj2;\n",
    "  GreenClass obj3;\n",
    "end C2b;  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('BlueClass',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "type BlueClass = Real(unit = \"blue\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('C',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class C\n",
    "  replaceable class ColoredClass = GreenClass;  //type parameter\n",
    "  ColoredClass         obj1(p1 = 5);\n",
    "  replaceable YellowClass obj2;\n",
    "  ColoredClass         obj3;\n",
    "end C;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('SmallPack',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "package SmallPack\n",
    "\n",
    "  constant Real mypi = 3.14159;\n",
    "\n",
    "  connector Pin\n",
    "    Voltage v;\n",
    "    flow Current i;\n",
    "  end Pin;\n",
    "\n",
    "  function multiply\n",
    "    input Real x;\n",
    "    input Real y = 0;\n",
    "    output Real result;\n",
    "  algorithm\n",
    "    result := x*y;\n",
    "  end multiply;\n",
    "\n",
    "end SmallPack;\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('Resistor',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model Resistor \"Electrical resistor\"\n",
    "   Pin p, n \"positive and negative pins\";\n",
    "   Voltage v;\n",
    "   Current i;\n",
    "   parameter Real R(unit=\"Ohm\") \"Resistance\";\n",
    "equation\n",
    "   v = i*R;\n",
    "end Resistor; "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "loadModel(Modelica)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('Multiply',)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "block Multiply\n",
    "  input Real x;\n",
    "  input Real y(start=0);\n",
    "  output Real result;\n",
    "equation\n",
    "  result = x*y;\n",
    "end Multiply;  "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "OpenModelica",
   "language": "OpenModelica",
   "name": "openmodelica"
  },
  "language_info": {
   "mimetype": "text/modelica",
   "name": "openmodelica",
   "version": "1.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
